package com.atguigu.gmall.product.service.impl;

import com.atguigu.gmall.common.result.Result;
import com.atguigu.gmall.model.product.BaseTrademark;
import com.atguigu.gmall.product.mapper.BaseTradeMarkMapper;
import com.atguigu.gmall.product.service.BaseTradeMarkService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.sun.org.apache.regexp.internal.RE;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * @author 里
 */
@Service
public class BaseTradeMarkServiceImpl extends ServiceImpl<BaseTradeMarkMapper,BaseTrademark> implements BaseTradeMarkService {
    //注入mapper层
    @Autowired
    private BaseTradeMarkMapper baseTradeMarkMapper;

    //根据分页条件查询品牌数据
    @Override
    public IPage getBaseTradeMarkPage(Page<BaseTrademark> baseTradeMarkPage) {
        // 封装排序条件
        QueryWrapper<BaseTrademark> baseTrademarkQueryWrapper = new QueryWrapper<>();
        baseTrademarkQueryWrapper.orderByDesc("id");
        return baseTradeMarkMapper.selectPage(baseTradeMarkPage,baseTrademarkQueryWrapper);
    }

}
